//
//  FRBookReadViewController+ReadContent.m
//  Fresh Reading
//
//  Created by Annie on 2020/5/25.
//  Copyright © 2020 Annie. All rights reserved.
//

#import "FRBookReadViewController+ReadContent.h"

@implementation FRBookReadViewController (ReadContent)





/// 根据Index创建 阅读VC
/// @param indexPath 页码信息
- (FRReadContentViewController *)contentVCWithIndexPath:(NSIndexPath *)indexPath{
    FRChapterModel *cModel = self.model.chapters[indexPath.section];
    FRReadContentModel *pModel = cModel.readContents[indexPath.row];
    return [self contentVCWithPageModel:pModel];
}

/// 根据模型创建阅读VC
/// @param pModel 分页模型
- (FRReadContentViewController *)contentVCWithPageModel:(FRReadContentModel *)pModel{
 
    FRReadContentViewController *vc = [FRReadContentViewController new];
    vc.delegate = self;
    vc.fr_model = pModel;
    return vc;
}


@end
